const system = uni.getSystemInfoSync();
const platform = system.osName;
const screenWitdh = system.screenWidth;
const screenHeight = system.screenHeight;

function platformVal(androidVal, iosVal) {
  return 'android' == platform ? androidVal : 'ios' == platform ? iosVal : '';
}

function calculateViewWidth(marginLeft, marginRight) {
  return screenWitdh - marginLeft - marginRight;
}

function calculateAndroidViewWidth(marginLeft, marginRight) {
  return screenH - marginLeft - marginRight;
}

function calculateViewX(superViewWidth, width, marginRight) {
  console.log(superViewWidth);
  console.log(superViewWidth - marginRight - width);
  return superViewWidth - marginRight - width;
}

export function buildFullscreen() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        bottomBgColor: '#FF0000',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setCheckBoxUi: {
        top: 10
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      }
    }
  };
}

export function buildPrivacyAlertFullscreen() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop
      },
      setCheckBoxUi: {
        top: 10
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: true,
        radius: [10, 10, 10, 10],
        backgroundColor: '#FFFFFF',
        width: platformVal(300, calculateViewWidth(20, 20)),
        height: platformVal(400, 200)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: true,
        top: 0,
        left: platformVal(335, calculateViewX(calculateViewWidth(20, 20), 40, 15))
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        //activeImgPath:"static/btn_normal.png",
        //hightedImgPath:"static/btn_pressed.png",
        textColor: '#000000',
        textSize: platformVal(17, 18),
        width: platformVal(100, 150),
        top: platformVal(40, 130),
        height: 50,
        left: platformVal(170, 210)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: platformVal(17, 18),
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(30, 40),
        top: platformVal(40, 130),
        width: platformVal(100, 150),
        height: 50
      }
    ]
  };
}

export function buildFullscreenPrivacyActionSheetStyle() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setCheckBoxUi: {
        top: 10
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: [10, 0, 0, 10],
        backgroundColor: '#FFFFFF',
        width: screenWitdh,
        height: platformVal(400, 300),
        top: screenHeight - platformVal(400, 300)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: false
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: platformVal(17, 18),
        width: calculateViewWidth(20, 20),
        top: platformVal(40, 130),
        height: 50,
        left: 20
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: platformVal(17, 18),
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: 20,
        top: platformVal(100, 200),
        width: calculateViewWidth(20, 20),
        height: 50
      }
    ]
  };
}

export function buildFullscreenPrivacyLandscapeAlertStyle() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 30);
  const numberTop = String(unit * 2 + 30);
  const loginBtnTop = String(unit * 3 + 40);
  const switchTop = String(unit * 4 + 60);

  return {
    uiConfig: {
      supportedInterfaceOrientations: (1 << 3) | (1 << 4),
      setScreenOrientation: 6,
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganHidden: true,
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: [10, 10, 10, 10],
        backgroundColor: '#FFFFFF',
        width: platformVal(300, calculateViewWidth(20, 20)),
        height: platformVal(300, 200)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: true,
        top: 0,
        left: platformVal(335, calculateViewX(calculateViewWidth(20, 20), 40, 15))
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: platformVal(17, 18),
        width: platformVal(100, 150),
        top: platformVal(40, 130),
        height: 50,
        left: platformVal(170, 210)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: platformVal(17, 18),
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(30, 40),
        top: platformVal(40, 130),
        width: platformVal(100, 150),
        height: 50
      }
    ]
  };
}

export function buildFullscreenPrivacyLandscapeActionSheetStyle() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  console.log(unit);
  const logoTop = String(unit * 1 - 30);
  const numberTop = String(unit * 2 + 30);
  const loginBtnTop = String(unit * 3 + 40);
  const switchTop = String(unit * 4 + 60);

  return {
    uiConfig: {
      supportedInterfaceOrientations: (1 << 3) | (1 << 4),
      setScreenOrientation: 6,
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganHidden: true,
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: platformVal([10, 10, 0, 0], [10, 0, 0, 10]),
        backgroundColor: '#FFFFFF',
        width: platformVal(screenHeight - 120, 400),
        height: platformVal(240, 300),
        top: platformVal(screenWitdh - 240, screenHeight - 300),
        left: platformVal(30, (screenWitdh - 400) * 0.5)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: false
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: platformVal(17, 18),
        width: platformVal(screenHeight - 400, 360),
        top: platformVal(10, 130),
        height: platformVal(40, 50),
        left: platformVal(140, 20)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: platformVal(17, 18),
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(140, 20),
        top: platformVal(60, 200),
        width: platformVal(screenHeight - 400, 360),
        height: platformVal(42, 50)
      }
    ]
  };
}

export function buildAlert() {
  const bodyHeight = plus.display.resolutionHeight;
  const bodyWidth = plus.display.resolutionWidth;
  const dialogWidth = parseInt(bodyWidth * 0.8);
  const dialogHeight = parseInt(dialogWidth / 0.618);
  const unit = parseInt(dialogHeight / 10);
  const logoTop = String(unit * 0.3);
  const sloganTop = String(unit * 2.5);
  const numberTop = String(unit * 3.2);
  const loginBtnTop = String(unit * 4.3);
  const switchTop = String(unit * 6.0);

  return {
    uiConfig: {
      setDialogTheme: {
        width: String(dialogWidth),
        height: String(dialogHeight)
      },
      setNavUi: {
        text: '一键登录',
        textColor: '#000000',
        bgColor: '#00FFFFFF',
        returnImgPath: 'static/close_black.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop,
        textSize: platformVal('23', '24')
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      }
    }
  };
}

export function buildSheet() {
  const bodyHeight = plus.display.resolutionHeight;
  const dialogHeight = 550;
  const unit = parseInt(dialogHeight / 10);
  const logoTop = String(unit * 0.3);
  const sloganTop = String(unit * 2.5);
  const numberTop = String(unit * 3.2);
  const loginBtnTop = String(unit * 4.3);
  const switchTop = String(unit * 6.0);

  return {
    uiConfig: {
      setSwitchHidden: 'true',
      setSloganHidden: 'true',
      setCheckboxHidden: 'true',
      setDialogTheme: {
        height: String(dialogHeight),
        isBottom: 'true'
      },
      setNavUi: {
        text: '一键登录',
        textColor: '#000000',
        bgColor: '#00FFFFFF',
        returnImgPath: 'static/close_black.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop,
        textSize: platformVal('23', '24')
      },
      setLoginBtnUi: {
        top: loginBtnTop
      },
      setCheckBoxUi: {
        defaultChecked: 'true'
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      }
    }
  };
}

export function buildFullscreenAndImageBg() {
  const bodyHeight = plus.screen.resolutionHeight;
  const bodyWidth = plus.screen.resolutionWidth;
  const designHeight = bodyHeight - 80;
  const unit = parseInt(designHeight / 20);
  const numberTop = String(unit * 11);
  const loginBtnTop = String(unit * 13);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavHidden: 'true',
      setLogoHidden: 'true',
      setSloganHidden: 'true',
      setSwitchHidden: 'true',
      setBackgroundUi: {
        backgroundColor: '#01001C',
        imagePath: 'static/background.png'
      },
      setNumberUi: {
        top: numberTop,
        textColor: '#FFFFFF'
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      }
    },
    widgets: [
      {
        widgetId: 'close',
        type: 'Button',
        left: '25',
        top: platformVal('0', '64'),
        width: '24',
        height: '24',
        backgroundImage: 'static/close_white.png'
      },
      {
        widgetId: 'line',
        type: 'Text',
        alignment: '1',
        textContent: '-其他方式登录-',
        textSize: '13',
        textColor: '#FFFFFF',
        backgroundColor: '#00FFFFFF',
        left: '10',
        top: String(unit * 16),
        width: String(bodyWidth - 20),
        height: '20'
      },
      {
        widgetId: 'alipay',
        type: 'Button',
        left: String(bodyWidth * 0.5 - 20 - 50),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/alipay_icon.png'
      },
      {
        widgetId: 'taobao',
        type: 'Button',
        left: String(bodyWidth * 0.5 + 20),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/taobao_icon.png'
      }
    ]
  };
}

export function buildFullscreenAndVideoBg() {
  const bodyHeight = plus.screen.resolutionHeight;
  const bodyWidth = plus.screen.resolutionWidth;
  const designHeight = bodyHeight - 80;
  const unit = parseInt(designHeight / 20);
  const numberTop = String(unit * 11);
  const loginBtnTop = String(unit * 13);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavHidden: 'true',
      setLogoHidden: 'true',
      setSloganHidden: 'true',
      setSwitchHidden: 'true',
      setBackgroundUi: {
        backgroundColor: '#01001C',
        videoPath: 'static/background_video.mp4'
      },
      setNumberUi: {
        top: numberTop,
        textColor: '#FFFFFF'
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      }
    },
    widgets: [
      {
        widgetId: 'close',
        type: 'Button',
        left: '25',
        top: platformVal('0', '64'),
        width: '24',
        height: '24',
        backgroundImage: 'static/close_white.png'
      },
      {
        widgetId: 'line',
        type: 'Text',
        alignment: '1',
        textContent: '-其他方式登录-',
        textSize: '13',
        textColor: '#FFFFFF',
        backgroundColor: '#00FFFFFF',
        left: '10',
        top: String(unit * 16),
        width: String(bodyWidth - 20),
        height: '20'
      },
      {
        widgetId: 'alipay',
        type: 'Button',
        left: String(bodyWidth * 0.5 - 20 - 50),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/alipay_icon.png'
      },
      {
        widgetId: 'taobao',
        type: 'Button',
        left: String(bodyWidth * 0.5 + 20),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/taobao_icon.png'
      }
    ]
  };
}

export function buildFullscreenAndGifBg() {
  const bodyHeight = plus.screen.resolutionHeight;
  const bodyWidth = plus.screen.resolutionWidth;
  const designHeight = bodyHeight - 80;
  const unit = parseInt(designHeight / 20);
  const numberTop = String(unit * 11);
  const loginBtnTop = String(unit * 13);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavHidden: 'true',
      setLogoHidden: 'true',
      setSloganHidden: 'true',
      setSwitchHidden: 'true',
      setBackgroundUi: {
        backgroundColor: '#01001C',
        gifPath: 'static/background_gif.gif'
      },
      setNumberUi: {
        top: numberTop,
        textColor: '#FFFFFF'
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      }
    },
    widgets: [
      {
        widgetId: 'close',
        type: 'Button',
        left: '25',
        top: platformVal('0', '64'),
        width: '24',
        height: '24',
        backgroundImage: 'static/close_white.png'
      },
      {
        widgetId: 'line',
        type: 'Text',
        alignment: '1',
        textContent: '-其他方式登录-',
        textSize: '13',
        textColor: '#FFFFFF',
        backgroundColor: '#00FFFFFF',
        left: '10',
        top: String(unit * 16),
        width: String(bodyWidth - 20),
        height: '20'
      },
      {
        widgetId: 'alipay',
        type: 'Button',
        left: String(bodyWidth * 0.5 - 20 - 50),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/alipay_icon.png'
      },
      {
        widgetId: 'taobao',
        type: 'Button',
        left: String(bodyWidth * 0.5 + 20),
        top: String(unit * 17),
        width: '50',
        height: '50',
        backgroundImage: 'static/taobao_icon.png'
      }
    ]
  };
}

export function buildFullscreenAndWebviewBg() {
  const bodyHeight = plus.screen.resolutionHeight;
  const bodyWidth = plus.screen.resolutionWidth;
  const designHeight = bodyHeight - 80;
  const unit = parseInt(designHeight / 20);
  const numberTop = String(unit * 7);
  const sloganTop = String(unit * 9);
  const loginBtnTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavHidden: 'true',
      setLogoHidden: 'true',
      setSwitchHidden: 'true',
      setBackgroundUi: {
        webviewPath: 'static/background_web.html'
      },
      setNumberUi: {
        top: numberTop,
        textColor: '#FFFFFF'
      },
      setSloganUi: {
        textColor: '#FFFFFF',
        textSize: platformVal('16', '17'),
        top: sloganTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      }
    },
    widgets: [
      {
        widgetId: 'close',
        type: 'Button',
        left: '25',
        top: platformVal('0', '64'),
        width: '24',
        height: '24',
        backgroundImage: 'static/close_white.png'
      },
      {
        widgetId: 'line',
        type: 'Text',
        alignment: '1',
        textContent: '-其他方式登录-',
        textSize: '13',
        textColor: '#FFFFFF',
        backgroundColor: '#00FFFFFF',
        left: '10',
        top: String(unit * 15),
        width: String(bodyWidth - 20),
        height: '20'
      },
      {
        widgetId: 'alipay',
        type: 'Button',
        left: String(bodyWidth * 0.5 - 20 - 50),
        top: String(unit * 16),
        width: '50',
        height: '50',
        backgroundImage: 'static/alipay_icon.png'
      },
      {
        widgetId: 'taobao',
        type: 'Button',
        left: String(bodyWidth * 0.5 + 20),
        top: String(unit * 16),
        width: '50',
        height: '50',
        backgroundImage: 'static/taobao_icon.png'
      }
    ]
  };
}

export function buildFullscreenAndWeexViewBg() {
  const bodyHeight = plus.screen.resolutionHeight;
  const bodyWidth = plus.screen.resolutionWidth;
  const designHeight = bodyHeight - 80;
  const unit = parseInt(designHeight / 20);
  const numberTop = String(unit * 7);
  const sloganTop = String(unit * 9);
  const loginBtnTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavHidden: 'true',
      setLogoHidden: 'true',
      setSwitchHidden: 'true',
      setBackgroundUi: {
        backgroundColor: '#1E5372',
        weexJsPath: 'static/background_weex.js'
      },
      setNumberUi: {
        top: numberTop,
        textColor: '#FFFFFF'
      },
      setSloganUi: {
        textColor: '#FFFFFF',
        textSize: platformVal('16', '17'),
        top: sloganTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      // setCheckBoxUi:{
      // 	top:10,
      // },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      }
    },
    widgets: [
      {
        widgetId: 'close',
        type: 'Button',
        left: '25',
        top: platformVal('0', '64'),
        width: '24',
        height: '24',
        backgroundImage: 'static/close_white.png'
      },
      {
        widgetId: 'line',
        type: 'Text',
        alignment: '1',
        textContent: '-其他方式登录-',
        textSize: '13',
        textColor: '#FFFFFF',
        backgroundColor: '#00FFFFFF',
        left: '10',
        top: String(unit * 15),
        width: String(bodyWidth - 20),
        height: '20'
      },
      {
        widgetId: 'alipay',
        type: 'Button',
        left: String(bodyWidth * 0.5 - 20 - 50),
        top: String(unit * 16),
        width: '50',
        height: '50',
        backgroundImage: 'static/alipay_icon.png'
      },
      {
        widgetId: 'taobao',
        type: 'Button',
        left: String(bodyWidth * 0.5 + 20),
        top: String(unit * 16),
        width: '50',
        height: '50',
        backgroundImage: 'static/taobao_icon.png'
      }
    ]
  };
}

export function buildFullscreenGlobalFontName() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      globalFontName: platformVal('serif', 'STHeitiSC-Medium'),
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24',
        fontName: platformVal('static/fonts/globalFont.ttf', 'PingFangSC-Regular')
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: [10, 10, 10, 10],
        backgroundColor: '#FFFFFF',
        width: platformVal(300, calculateViewWidth(20, 20)),
        height: platformVal(400, 200)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: true,
        top: 0,
        left: platformVal(335, calculateViewX(calculateViewWidth(20, 20), 40, 15))
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: 18,
        width: platformVal(100, 150),
        top: platformVal(40, 130),
        height: 50,
        left: platformVal(170, 210)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: 18,
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(30, 40),
        top: platformVal(40, 130),
        width: platformVal(100, 150),
        height: 50
      }
    ]
  };
}
export function buildFullscreenSingleFontName() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      globalFontName: platformVal('static/fonts/globalFont.ttf', 'STHeitiSC-Medium'),
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24',
        fontName: platformVal('static/fonts/globalFont.ttf', 'static/testFont.ttf')
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop,
        fontName: 'static/fonts/testFont.ttf',
        textSize: 25
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: [10, 10, 10, 10],
        backgroundColor: '#FFFFFF',
        width: platformVal(300, calculateViewWidth(20, 20)),
        height: platformVal(400, 200)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: true,
        top: 0,
        left: platformVal(335, calculateViewX(calculateViewWidth(20, 20), 40, 15))
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: 18,
        width: platformVal(100, 150),
        top: platformVal(40, 130),
        height: 50,
        fontName: 'static/fonts/testFont.ttf',
        left: platformVal(170, 210)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: 18,
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(30, 40),
        top: platformVal(40, 130),
        width: platformVal(100, 150),
        height: 50
      }
    ]
  };
}
export function buildFullscreenPrivacySignalColor() {
  const unit = parseInt((plus.screen.resolutionHeight - 80) / 20);
  const logoTop = String(unit * 1 - 10);
  const sloganTop = String(unit * 5);
  const numberTop = String(unit * 6 + 20);
  const loginBtnTop = String(unit * 9);
  const switchTop = String(unit * 12);

  return {
    uiConfig: {
      setStatusBarStyle: '1',
      setNavUi: {
        text: '一键登录',
        textColor: '#FFFFFF',
        bgColor: '#0faeff',
        returnImgPath: 'static/nav_back.png',
        returnImgWidth: '24',
        returnImgHeight: '24'
      },
      setLogoUi: {
        imgPath: 'static/mytel_app_launcher.png',
        top: logoTop
      },
      setSloganUi: {
        top: sloganTop
      },
      setNumberUi: {
        top: numberTop
      },
      setLoginBtnUi: {
        top: loginBtnTop
        // color:'#D8BFD8'
      },
      setSwitchUi: {
        textColor: '#0faeff',
        top: switchTop
      },
      setPrivacyUi: {
        expandAuthPageCheckedScope: true,
        operatorColor: '#F534D2',
        oneColor: '#FF0000',
        twoColor: '#00FF00',
        threeColor: '#0000FF',
        beforeText: '请阅读并同意',
        endText: '，谢谢'
      },
      setAppPrivacyOne: {
        title: '用户协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setAppPrivacyTwo: {
        title: '隐私政策',
        url: 'https://iyimeng.com/user/privacy.html'
      },
      setAppPrivacyThree: {
        title: '服务协议',
        url: 'https://iyimeng.com/user/user.html'
      },
      setPrivacyAlertIsNeedShow: true,
      setPrivacyAlertUi: {
        needAutoLogin: false,
        radius: [10, 10, 10, 10],
        backgroundColor: '#FFFFFF',
        width: platformVal(300, calculateViewWidth(20, 20)),
        height: platformVal(400, 200)
      },
      setPrivacyAlertMaskUi: {
        needShow: true,
        tapMaskClosed: true,
        color: '#000000',
        alpha: 0.5
      },
      setPrivacyAlertTitleUi: {
        backgroundColor: '#FFFFFF',
        alignment: 1,
        text: '请同意',
        textSize: platformVal(16, 20),
        textColor: '#000000',
        top: 10
      },
      setPrivacyAlertCloseUi: {
        needShow: true,
        top: 0,
        left: platformVal(335, calculateViewX(calculateViewWidth(20, 20), 40, 15))
      },
      setPrivacyAlertContentUi: {
        backgroundColor: '#FFFFFF',
        textSize: platformVal(14, 18),
        alignment: 1,
        top: platformVal(10, 50),
        width: 335,
        left: 40,
        privacyAlertOperatorColor: '#F534D2',
        privacyAlertOneColor: '#FF0000',
        privacyAlertTwoColor: '#00FF00',
        privacyAlertThreeColor: '#0000FF',
        privacyAlertBeforeText: '请阅读并同意',
        privacyAlertEndText: '，谢谢'
      },
      setPrivacyAlertConfirmUi: {
        text: '我已阅读',
        color: '#FF7F00',
        textColor: '#FFFFFF',
        textSize: 18,
        width: platformVal(100, 150),
        top: platformVal(40, 130),
        height: 50,
        left: platformVal(170, 210)
      }
    },
    privacyAlertWidgets: [
      {
        widgetId: 'closePrivacyAlert',
        type: 'Button',
        textContent: '取消',
        textSize: 18,
        textColor: '#000000',
        borderColor: '#FF7F00',
        borderWidth: 1,
        backgroundColor: '#FFFFFF',
        left: platformVal(30, 40),
        top: platformVal(40, 130),
        width: platformVal(100, 150),
        height: 50
      }
    ]
  };
}
